{% extends 'basic.html' %}
{% block title %}新增课程类型{% endblock %}
{% block content %}
{% load static %}
<h3>新增课程类型</h3>
<form id="add-type-form">
    {% csrf_token %}
    <label for="type-name">课程类型名称：</label>
    <input type="text" id="type-name" name="type_name" placeholder="请输入课程类型名称">
    <button type="submit">提交</button>
</form>

<h3>已有课程类型</h3>
<ul id="course-type-list">
    {% for course_type in course_types %}
        <li>
            <span>{{ course_type.type_name }}</span>
        </li>
    {% empty %}
        <li class="empty">暂无课程类型</li>
    {% endfor %}
</ul>
<div class="back-to-main">
    <a href="{% url 'main_page' %}" class="back-btn">返回主页面</a>
</div>
<link rel="stylesheet" href="{% static 'css/add_type.css' %}">
<script src="{% static 'js/add_type.js' %}"></script>
{% endblock %}